|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
www.fairchildsemi.com rev. 1.1.3 10/25/00 features 50 mhz (20ns) pipelined throughput 3 simultaneous 12-bit input and output channels (64 giga {2 36 } colors) two's complement inputs and outputs over?w headroom available in lower resolution 10-bit user-de?ed coef?ients ttl compatible input and output signals full precision internal calculation output rounding on-board coef?ient memory submicron cmos process applications translation between component color standards (rgb, yiq, yuv, etc.) broadcast composite color encoding and decoding (all standards) broadcast composite color standards conversion and transcoding camera tube and monitor phosphor colorimetry correction white balancing and color-temperature conversion image capture, processing and storage color matching between systems, cameras and monitors three-dimensional perspective translation description a 50-mhz, three-channel, 36 bit (three 12-bit components) colorspace converter and color corrector, the TMC2272A uses 9 parallel multipliers to process high-resolution imagery in real time. the TMC2272A also operates at any slower clock rate and with any smaller data path width, allowing it to handle all broadcast and consumer camera, frame-grabber, encoder/ decoder, recorder and monitor applications as well as most electronic imaging applications. a complete set of three 12-bit samples is processed on every clock cycle, with a five-cycle pipeline latency. full 23-bit (for each of three components) internal precision is provided with 10-bit user-defined coefficients. the coefficients may be varied dynamically, with three new coefficients loaded every clock cycle. (the full set of nine can be replaced in three clock cycles.) rounding to 12 bits per component is performed only at the final output. this allows full accuracy with correct rounding and overflow headroom for applications that require less than 12 bits per component. the TMC2272A is fabricated in a submicron cmos process and performance is guaranteed over the full operating tem- perature range. it is available in a 120-pin plastic pin grid array (ppga) package, 120-pin ceramic pin grid array (cpga), 120-pin mqfp to pga package, and 120-pin plastic quad flatpack (pqfp) in three speed grades. logic symbol a 11-0 b 11-0 c 11-0 x 11-0 y 11-0 z 11-0 ka 11-0 kb 11-0 kc 11-0 csel 1-0 clk TMC2272A colorspace converter data input data output coefficient input TMC2272A digital colorspace converter 36 bit color, 50 mhz
product specification TMC2272A 2 rev. 1.1.3 10/25/00 block diagram 12 z 11-0 12 5 12 y 11-0 12 5 kax ena ena ena ena ena ena ena ena ena a 11-0 cwsel 1,0 cwsel 1,0 = 0 1 enable k_x cwsel 1,0 = 1 0 enable k_y cwsel 1,0 = 1 1 enable k_z 12 2 ka 9-0 10 b 11-0 12 kb 9-0 10 c 11-0 12 kc 9-0 10 12 21 10 10 1 kay 12 21 10 10 3 4 kaz 12 21 10 10 3 4 kbx 12 21 10 10 1 3 4 kby 12 21 10 10 3 4 kbz 12 21 10 10 3 4 kcx 12 21 10 10 1 12 x 11-0 12 3 4 kcy 12 21 10 10 3 4 kcz 12 21 10 10 3 4 3 4 5 (round) (round) (round) 222 222 2 decoder 22 clk TMC2272A product specification rev. 1.1.3 10/25/00 3 pin assignments 120 pin plastic pin grid array, h5 package, 120 pin ceramic pin grid array, g1 package, and 120 pin mqfp to ppga, h6 package b adefghjklmn c 1 2 3 4 5 6 7 8 9 10 11 12 13 top view cavity up key x 7 x 9 x 10 gnd c 11 c 8 c 7 c 5 c 3 c 1 b 10 b 7 b 4 x 4 x 5 x 8 x 11 gnd c 9 c 6 c 4 c 2 b 11 b 9 b 6 b 2 x 1 x 2 x 6 v dd a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 c1 c2 c3 c4 gnd c 10 gnd v dd c 0 b 8 b 5 b 3 b 1 y 11 x 0 x 3 clk b 0 a 10 y 9 y 10 gnd a 11 a 9 a 8 y 7 y 8 v dd a 7 a 6 a 5 y 5 y 6 gnd c5 c6 c7 c8 c9 c10 c11 c12 c13 d1 d2 d3 d11 d12 d13 e1 e2 e3 e11 e12 e13 f1 f2 f3 f11 f12 f13 g1 g2 g3 pin name pin name a 3 a 2 a 4 y 4 y 0 v dd gnd a 0 a 1 y 1 y 2 gnd ka 8 cwsel 1 cwsel 0 y 3 z 0 z 3 ka 4 ka 7 ka 9 z 1 z 4 z 6 gnd kc 0 gnd v dd kb 0 kb 4 g11 g12 g13 h1 h2 h3 h11 h12 h13 j1 j2 j3 j11 j12 j13 k1 k2 k3 k11 k12 k13 l1 l2 l3 l4 l5 l6 l7 l8 l9 kb 8 ka 1 ka 5 ka 6 z 2 z 7 z 9 z 11 kc 2 kc 4 kc 6 kc 9 kb 2 kb 5 kb 9 ka 2 ka 3 z 5 z 8 z 10 kc 1 kc 3 kc 5 kc 7 kc 8 kb 1 kb 3 kb 6 kb 7 ka 0 l10 l11 l12 l13 m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 pin name pin name functional description the TMC2272A is a nine?ultiplier array with the internal bus structure and summing adders needed to implement a 3 x 3 matrix multiplier (triple dot product). with a 50mhz guaran- teed maximum clock rate, this device offers video and imaging system designers a single?hip solution to numerous common image and signal?rocessing problems. the three data input ports (a 11-0 , b 11-0 , c 11-0 ) accept 12-bit two's complement integer data, which is also the format for the output ports (x 11-0 , y 11-0 , z 11-0 ). other format and path width options are discussed in the numeric format and over- ?w section. the coef?ient input ports (ka, kb, kc) are always 10-bit two's complement fractional. table 2 details the bit weighting. full precision is maintained throughout the TMC2272A. each output is accurately rounded to 12 bits from the 23 bits entering the final adder. signal de?itions a(n), b(n), c(n) indicates the data word presented to that input port during the specified clock rising edge (n). applies to input ports a 11-0 , b 11-0 , and c 11-0 . kax(n) thru kcz(n) indicates coefficient value stored in the specified one of the nine onboard coefficient registers kax through kcz, input during or before the specified clock rising edge (n). x(n), y(n), z(n) indicates data available at that output port t do after the specified clock rising edge (n). applies to output ports x 11-0 , y 11-0 , and z 11-0 . the TMC2272A utilizes six input and output ports to realize a "triple dot product", in which each output is the sum of all three input words, multiplied by the appropriate stored coef- ficients. the three corresponding sums of products are avail- able at the outputs five clock cycles after the input data are latched, and three new data words rounded to 12-bits are then available every clock cycle. see the applications discussion regarding encoded video standard conversion matrices. x(5)=a(1)kax(1)+b(1)kbx(1)+c(1)kcx(1) y(5)=a(1)kay(1)+b(1)kby(1)+c(1)kcy(1) z(5)=a(1)kaz(1)+b(1)kbz(1)+c(1)kcz(1) product specification TMC2272A 4 rev. 1.1.3 10/25/00 pin assignments (continued) 120 pin metric quad flat pack (mqfp), ke package pin descriptions pin name cpga/ppga/ mpga pin number ke pin number pin function description power v dd f3, h3, l7, c8, c4 12, 20, 46, 102, 118 supply voltage. the TMC2272A operates from a single +5v supply. all pins must be connected. gnd e3, g3, j3, l4, l6, h11, c7, c5, a4, b5 8, 16, 24, 34, 42, 72, 106, 112, 113, 114 ground clock clk d11 88 system clock. the TMC2272A operates from a single system clock input. all timing specifications are referenced to the rising edge of clock. controls cwsel 1,0 j12, j13 70, 71 coefficient write select. this input selects which three of the 9 coefficient registers, if any, will be updated on the next clock cycle from the ka 9-0 , kb 9-0 , and kc 9-0 inputs. see table 4 and the functional block diagram. x 6 x 5 x 4 x 3 x 2 x 1 x 0 gnd y 11 y 10 y 9 v dd y 8 y 7 y 6 gnd y 5 y 4 y 0 v dd y 1 y 2 y 3 gnd z 0 z 1 z 2 z 3 z 4 z 5 1 30 120 91 31 60 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 90 61 z 6 z 7 z 8 gnd z 9 z 10 z 11 kc 0 kc 1 kc 2 kc 3 gnd kc 4 kc 5 kc 6 v dd kc 7 kc 8 kc 9 kb 0 kb 1 kb 2 kb 3 kb 4 kb 5 kb 6 kb 7 kb 8 kb 9 ka 0 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 pin name pin name ka 1 ka 2 ka 3 ka 4 ka 5 ka 6 ka 7 ka 8 ka 9 cwsel 1 cwsel 0 gnd a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9 a 10 a 11 b 0 b 1 b 2 clk b 3 b 4 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 b 5 b 6 b 7 b 8 b 9 b 10 b 11 c 0 c 1 c 2 c 3 v dd c 4 c 5 c 6 gnd c 7 c 8 c 9 c 10 c 11 gnd gnd gnd x 11 x 10 x 9 v dd x 8 x 7 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 pin name pin name TMC2272A product specification rev. 1.1.3 10/25/00 5 table 1. coef cient loading inputs a 11-0 e11, d13, e12, e13, f11, f12, f13, g13, g11, g12, h13, h12 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73 data input a. this is one of three 12-bit wide data input ports. b 11-0 b10, a11, b11, c10, a12, b12, c11, a13, c12, b13, c13, d12 97, 96, 95, 94, 93, 92, 91, 90, 89, 87, 86, 85 data input b. this is one of three 12-bit wide data input ports. c 11-0 a5, c6, b6, a6, a7, b7, a8, b8, a9, b9, a10, c9 111, 110, 109, 108, 107, 105, 104, 103, 101, 100, 99, 98 data input c. this is one of three 12-bit wide data input ports. ka 9-0 k13, j11, k12, l13, l12, k11, m13, m12, l11, n13 69, 68, 67, 66, 65, 64, 63, 62, 61, 60 coefficient input kax, kay, or kaz. these are the 10-bit wide coefficient input ports. the value at each of these three inputs will update one coefficient register as selected by the coefficient write select (cwsel 1-0 ) on the next clock. see table 1 and the functional block diagram. kb 9-0 m11, l10, n12, n11, m10, l9, n10, m9, n9, l8 59, 58, 57, 56, 55, 54, 53, 52, 51, 50 coefficient input kbx, kby, or kbz. these are the 10-bit wide coefficient input ports. the value at each of these three inputs will update one coefficient register as selected by the coefficient write select (cwsel 1-0 ) on the next clock. see table 1 and the functional block diagram. kc 9-0 m8, n8, n7, m7, n6, m6, n5, m5, n4, l5 49, 48, 47, 45, 44, 43, 41, 40, 39, 38 coefficient input kcx, kcy, or kcz. these are the 10-bit wide coefficient input ports. the value at each of these three inputs will update one coefficient register as selected by the coefficient write select (cwsel 1-0 ) on the next clock. see table 1 and the functional block diagram. outputs x 11-0 b4, a3, a2, b3, a1, c3, b2, b1, d3, c2, c1, d2 115, 116, 117, 119, 120, 1, 2, 3, 4, 5, 6, 7 output x. these are the data outputs. data are available at the 12-bit registered output ports x,y and z t do after every clock rising edge. y 11-0 d1, e2, e1, f2, f1, g2, g1, h1, k1, j2, j1, h2 9, 10, 11, 13, 14, 15, 17, 18, 23, 22, 21, 19 output y. these are the data outputs. data are available at the 12-bit registered output ports x,y and z t do after every clock rising edge. z 11-0 m4, n3, m3, n2, m2, l3, n1, l2, k3, m1, l1, k2 37, 36, 35, 33, 32, 31, 30, 29, 28, 27, 26, 25 output z. these are the data outputs. data are available at the 12-bit registered output ports x,y and z t do after every clock rising edge. cwsel 1,0 00 01 10 11 hold load load load input ka 9-0 all kax kay kaz hold load load load input kb 9-0 all kbx kby kbz hold load load load input kc 9-0 all kcx kcy kcz pin descriptions (continued) pin name cpga/ppga/ mpga pin number ke pin number pin function description product specification TMC2272A 6 rev. 1.1.3 10/25/00 figure 1. impulse response figure 2. input/output timing 1 01 10 11 001.0000 kax + kbx + kcx kay + kby + kcy kaz + kbz + kcz (k_x) (k_y) (k_z) 00 clk cwsel 1,0 ka, kb, kc data in a, b, c x out y out 2345678 t cy t s t h t ho t d previous new t pwl t pwh 1 clk cwsel 1,0 ka, kb, kc x, y, z 2345 numeric format and over ow table 2 shows the binary weightings of the input and output ports of the TMC2272A. although the internal sums of products could grow to 23 bits, the outputs x, y, and z are rounded to yield 12-bit integer words. thus the output format is identical to the input data format. bit weighting is easily adjusted by applying the same scaling correction factor to both input and output data words. as shown in table 2, the TMC2272A? matched input and output data formats accommodate 0db (unity) gain. there- fore the user must be aware of input conditions that could lead to numeric overflow. maximum input data and coefficient word sizes must be taken into account with the specific trans- lation performed to ensure that no overflow occurs. use with fewer than 12 bits the TMC2272A can be configured to provide several format and overflow options when used in systems with fewer than 12 bits of resolution. an 8-bit system will be used as an ex- ample, however these concepts apply to any other word width. the most apparent mode of operation is to left justify the in- coming data and to ground the unused input lsbs. hoever, the outputs will still be rounded to the least significant bit of the TMC2272A, having little if any effect on the top 8 bits actually used. because the TMC2272A carries out all calcu- lations to full precision, the preferred mode of operation is to right jusitfy and sign extend the data as shown in figure 3. since all the lsbs are used, the desired output will be rounded correctly, and overflow will be accommodated by bits 7 through 10. TMC2272A product specification rev. 1.1.3 10/25/00 7 the TMC2272A may also be used in unsigned binary 8-bit systems as shown in figure 4. bits 11 through 8 will handle overflow. in all applications, a digital zero (ground) should be connect- ed to all unused inputs. table 2. bit weightings for input and output data words a minus sign indicates a two? complement sign bit. bit weights 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 ? 2 -1 2 -2 2 -3 2 -4 2 -5 2 -6 2 -7 2 -8 2 -9 inputs all modes data a, b, c -i 11 i 10 i 9 i 8 i 7 i 6 i 5 i 4 i 3 i 2 i 1 i 0 coefficients ka, kb, kc -k 9 k 8 k 7 k 6 k 5 k 4 k 3 k 2 k 1 k 0 internal sum -x 20 x 19 x 18 x 17 x 16 x 15 x 14 x 13 x 12 x 11 x 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 x 0 outputs x, y, z -o 11 o 10 o 9 o 8 o 7 o 6 o 5 o 4 o 3 o 2 o 1 o 0 figure 3. two s complelent 8-bit application figure 4. binary 8-bit application msb(11) (10) (9) (8) (7) (6) (5) (4) (3) (2) (1) lsb(0) msb(7) sign extension (6) (5) (4) (3) (2) (1) lsb(0) msb(7) nc/ overflow (will accumulate overflow) (6) (5) (4) (3) (2) (1) lsb(0) inputs (a 11-0 , b 11-0 , or c 11-0 ) outputs (x 11-0 , y 11-0 , or z 11-0 ) tmc2272 bit weightings msb(11) (10) (9) (8) (7) (6) (5) (4) (3) (2) (1) lsb(0) msb(7) gnd gnd gnd gnd (6) (5) (4) (3) (2) (1) lsb(0) msb(7) nc/ overflow (will accumulate overflow) (6) (5) (4) (3) (2) (1) lsb(0) inputs (a 11-0 , b 11-0 , or c 11-0 ) outputs (x 11-0 , y 11-0 , or z 11-0 ) tmc2272 bit weightings product specification TMC2272A 8 rev. 1.1.3 10/25/00 figure 5. equivalent digital input circuit figure 6. equivalent digital output circuit data or control input v dd p n gnd v dd p n gnd output absolute maximum ratings (beyond which the device may be damaged)1 notes: 1. absolute maximum ratings are limiting values applied individually while all other parameters are within specified operating conditions. functional operation under any of these conditions is not implied. performance and reliability are guaranteed only if operating conditions are not exceeded. 2. applied voltage must be current limited to specified range. 3. forcing voltage must be limited to specified range. 4. current is specified as conventional current flowing into the device. parameter min typ max unit supply voltage -0.5 7.0 v input voltage -0.5 v dd + 0.5 v applied voltage 2 -0.5 v dd + 0.5 v externally forced current 3,4 -3.0 6.0 ma short circuit duration (single output in high state to ground) 1 sec operating, ambient temperature -20 110 c junction temperature 140 c storage temperature -65 150 c lead soldering temperature (10 seconds) 300 c TMC2272A product specification rev. 1.1.3 10/25/00 9 operating conditions electrical characteristics notes: 1. except pins xc 11-0 , yc 11-8 . 2. pins xc 11-0 , yc 11-8 . parameter min nom max units v dd power supply voltage 4.75 5.0 5.25 v f clk clock frequency TMC2272A 30 mhz TMC2272A-2 40 mhz TMC2272A-3 50 mhz t pwh clk pulse width, high 6 ns t pwl clk pulse width, low 8 ns t s input data setup time 6 ns t h input data hold time 2 ns v ih input voltage, logic high 2.0 v v il input voltage, logic low 0.8 v i oh output current, logic high -2.0 ma i ol output current, logic low 4.0 ma t a ambient temperature, still air 0 70 c parameter conditions min typ max units i dd total power supply current v dd = max, c load = 25pf, f clk = max TMC2272A 125 ma TMC2272A-2 140 ma TMC2272A-3 155 ma i ddu power supply current, unloaded v dd = max, f clk =max TMC2272A 120 ma TMC2272A-2 135 ma TMC2272A-3 150 ma i ddq power supply current, quiescent v dd = max, clk = low 12 ma c pin i/o pin capacitance 5 pf i ih input current, high 1 v dd = max, v in = v dd 5 a i il input current, low 1 v dd = max, v in = 0 v 5 a i ozh hi-z output leakage current, output high 2 v dd = max, v in = v dd 10 a i ozl hi-z output leakage current, output low 2 v dd = max, v in = 0 v 10 a i os short-circuit current -20 -80 ma v oh output voltage, high i oh = max, v dd = min 2.4 v v ol output voltage, low i ol = max, v dd = min 0.4 v product specification TMC2272A 10 rev. 1.1.3 10/25/00 switching characteristics parameter conditions min typ max units t do output delay time c load = 25 pf 15 ns t ho output hold time c load = 25 pf 3 ns applications discussion the TMC2272A can convert between any two three-coordinate colorspaces with the selection of the proper coefficients. sets of coefficients for some popular colorspace conversions are presented below. by concatenating coef?ient matrices of single transforma- tions, the user can program the TMC2272A to perform compound transforms ef?iently. for example, given an rgb input, correction of the relative values of r and b, for color temperature, conversion to yiq, modi?ation of contrast by changing y, and conversion back to rgb can be performed as quickly and easily as any simple transformation. to calculate the ?al set of coef?ients from the coef?ients of the individual transformations, the procedure in figure 7 (concatenation) is used. if more than two matrices are to be combined, the result from the concatenation of the ?st two matrices is concatenated with the third. if more matrices must be incorporated in the ?al function, the last step is repeated. figure 7. concatenation abc de f gh i jkl mn o pqr aj + bm + cp dj + em + fp gj + hm + ip ak + bn + cq dk + en + fq gk + hn + iq al + bo + cr dl + eo + fr gl + ho + ir = converting from gbr to yc b c r with the right coefficients, two external not gates, and an external 4-bit half-adder, the TMC2272A can convert video data from 8-bit full-scale (e.g. vga) gbr components to 10- bit yc b c r components. table 3. 10-bit component formats and inclusive ranges. the analog de?ing equations for 1 volt luminance and ?.5 volt color difference components are: y = + 0.5870 (g) + 0.1140 (b) + 0.2990 (r) b y = 0.3313 (g) + 0.5000 (b) ? 0.1687 (r) r y = 0.4187 (g) ? 0.0813 (b) + 0.5000 (r) to translate these equations into the digital domain, note that the ranges of r, g, and b are 0 to 255 instead of 0 to 1, the range of y is 64 to 940 instead of 0 to 1, and the ranges of u and v are 64 to 960 instead of +/-0.5: y = (876/255)(0.587(g)+0.114(b)+0.299(r))+64 = 2.01652 (g)+0.39162(b)+1.02715(r) +64 c b = (896/255)(0.3313(g)+0.5(b)-0.1687(r))+512 = -1.16397(g)+1.75686(b)-0.59289(r)+512 c r = (896/255)(-0.4187(g)-0.0813(b)+0.5(r))+512 = -1.47115(g)-0.28571(b)+1.75686(b))+512 let y'=y-64, u'=c b -512, and v'=c r - 512. the TMC2272A will compute y', u', and v'. adding 64 (040 h ) externally to y' will then yield y, whereas inverting the most signi?ant bits of u' and v', u'9 and v'9, will yield c b and c r , respectively. multiplying the equations immediately above by 128 and rounding each coef?ient to the nearest integer yields the rec- ommended set of coef?ients for gbr to yuv conversion. color space term range format y luminance 64-940 magnitude y' y - 64 0-876 magnitude c b color difference, blue 64-960 magnitude u' c b - 512 448 2 s comp c r color difference, red 64-960 magnitude v' c r - 512 448 2 s comp gbr green, blue, red components 0-255 magnitude, 8-bits TMC2272A product specification rev. 1.1.3 10/25/00 11 128 (y') = 258 (g) +50 (b) +131 (r) dec. 102 032 083 hex 128 (u') = -149 (g) +225 (b) -76 (r) dec 36b 0e1 3b4 hex 128l (v') = -188 (g) -37 (b) +225 (r) dec. 344 3db 0e1 hex if the TMC2272A input data alignment for 8-bit gbr is: 0 0 g7 g6 g5 g4 g3 g2 g1 g0 0 0 0 0 b7 b6 b5 b4 b3 b2 b1 b0 0 0 0 0 r7 r6 r5 r4 r3 r2 r1 r0 0 0 then the output data alignment for 10-bit y'u'v' is: 0 0 y9 y8 y7 y6 y5 y4 y3 y2 y1 y0 u9 u9 u9 u8 u7 u6 u5 u4 u3 u2 u1 u0 v9 v9 v9 v8 v7 v6 v5 v4 v3 v2 v1 v0 where the tripled u9 and v9 sign bits denote two s complement sign extensions. the factors of 4 in the input data format and 128 in the equations are absorbed by the internal 9-bit (factor of 512) right-shifting of the emerging results. at the output of the TMC2272A, invert the most signi?ant bits, u9 and v9, of the chrominance components, and add 1 at y6 of the luminance to obtain the true ccir rec. 601 values. converting from gbr to 8-bit full-scale yuv with the right coef?ients and two external not gates, the TMC2272A can convert video data from 8-bit full-scale (e.g. vga) gbr components to 8-bit full-scale yuv components. table 4. 8-bit component formats and inclusive ranges: color space term range format y luminance 0-255 magnitude u color difference, blue 128 to -127 2 s comp u' u + 128 0-255 magnitude v color difference, red 128 to -127 2 s comp v' v + 128 0-255 magnitude g,b,r green, blue, red components 0-255 magnitude as in the previous rgb to yc b c r case, begin with the de?ing equations, but without the range compensation factors of 255/876 and 255/896: y = 0.5870 (g) +0.1140 (b) +0.2990 (r) u = -0.3313 (g) +0.5000 (b) -0.1687 (r) v = -0.4187 (g) -0.0813 (b) +0.5000 (r) the TMC2272A will compute y, u, and v directly, whereas inverting the most signi?ant bits of u and v, u7 and v7 will yield u' and v', respectively. multiplying the equations immediately above by 512 and rounding each coef?ient to the nearest integer yields the recommended set of coef? cients for gbr to yuv conversion. product specification TMC2272A 12 rev. 1.1.3 10/25/00 512 (y) = 301 (g) + 58 (b) + 153 (r) dec. 12d 03a 099 hex 512 (u) = 170 (g) + 256 (b) 86 (r) dec. 356 100 3aa hex 512 (v) = 214 (g) 42 (b) + 256 (r) dec. 32a 3d6 100 hex if the TMC2272A input data alignment for 8-bit gbr is: 0 0 0 0 g7 g6 g5 g4 g3 g2 g1 g0 0 0 0 0 b7 b6 b5 b4 b3 b2 b1 b0 0 0 0 0 r7 r6 r5 r4 r3 r2 r1 r0 then the output data alignment for 8-bit yuv is: 0 0 0 0 y7 y6 y5 y4 y3 y2 y1 y0 u7 u7 u7 u7 u7 u6 u5 u4 u3 u2 u1 u0 v7 v7 v7 v7 v7 v6 v5 v4 v3 v2 v1 v0 where the quintupled u9 and v9 sign bits denote two s com- plement sign extensions. the factor of 512 in the equations above is absorbed by the internal 9-bit right shift of each emerging result. at the output of the TMC2272A, invert the most signi?ant bits, u7 and v7, of the chrominance components, to obtain the 8-bit offset format. converting from yc b c r to gbr following the notation employed earlier, the TMC2272A will be used to convert data in y'u'v' format into gbr format. since y' = 876, u' = v' = 0, and g = b = r = 255 for saturated white output, every y' coef?ient will be 225/876 = 0.29110. the full analog matrix for y'u'v' to gbr conversion is: g = 0.29110 (y') ?0.09794 (u') ?0.20324 (v') b = 0.29110 (y') + 0.50431 (u') r = 0.29110 (y') + 0.39901 (v') since the largest element is just over 0.5 and the largest per- missible coef?ient is 511, multiply all elements of the matrix by 512 to obtain the values to load into the TMC2272A. g = 149 (y' ) 50 (u') 04 (v') dec. 095 3ce 398 hex b = 149 (y') + 258 (u') dec. 095 100 hex r = 149 (y') + 204 (v') dec. 095 0cc hex decrease the incoming luminance at the input to the TMC2272A by 64 by adding 1 s at positions y9, y8, y7, and y6. invert u9 and v9 and their sign extensions, to accom- modate ccir rec. 601 data. instead of reducing y by 64, an alternate is to reduce each of the g, b, and r outputs by (255) (64 / 876) = 19. for the y'u'v' to rgb conversion, the TMC2272A input data alignment for 10-bit y'u'v' is: 0 0 y9y8y7y6y5y4y3y2y1y0 u9 u9 u9 u8 u7 u6 u5 u4 u3 u2 u1 u0 v9 v9 v9 v8 v7 v6 v5 v4 v3 v2 v1 v0 where the tripled u9 and v9 sign bits denote two s comple- ment sign extensions. the TMC2272A output data align- ment for 8-bit gbr is then: 0000g7g6g5g4g3g2g1g0 0000b7b6b5b4b3b2b1b0 0000r7r6r5r4r3r2r1r0 converting from 8-bit full scale yuv to gbr following the notation employed earlier, the TMC2272A will be used to convert data in 8-bit yuv format into 8-bit gbr format. TMC2272A product specification rev. 1.1.3 10/25/00 13 since y = 256, u = v = 0, and g = b = r = 255 for saturated white output, every y coef?ient will be 255 / 255=1.0. the full matrix for yuv to gbr conversion is: g = 1.0 (y) -0.3443 (u) -0.7142 (v) b = 1.0 (y) +1.7727 (u) r = 1.0 (y) +1.3965 (v) since the largest element is over 1.0 and the largest permissi- ble coef?ient is 511, multiply all elements of the matrix by 256 to obtain the values to load into the TMC2272A: g = 256 (y') - 88 (u') - 83 (v') dec. 100 3a8 349 hex b = 256 (y') + 454 (u') dec. 100 1c6 hex r = 256 (y') + 359 (v') dec. 100 167 hex for the yuv to rgb conversion, the TMC2272A input data alignment for 10-bit y'u'v' is: 0 y9y8y7y6y5y4y3y2y1y00 u9 u9 u8 u7 u6 u4 u4 u3 u2 u1 u0 0 v9 v9 v8 v7 v6 v5 v4 v3 v2 v1 v0 0 where the doubled u9 and v9 sign bits denote two s comple- ment sign extensions. the TMC2272A output data align- ment for 8-bit gbr is then: 0000g7g6g5g4g3g2g1g0 0000b7b6b5b4b3b2b1b0 0000r7r6r5r4r3r2r1r0 note that the inputs have to be doubled because the coef? cient gain is 256, whereas the internal gain is 1 / 512, for a net gain of 1/2. table 5. summary of colorspace conversion coef cients table 6. conversion port assignments and alignments where x y-0 denotes right-justified, (e) denotes sign extension, and x y-1 denotes shifted one bit leftward from a right-justified position. conversion kax kay kaz kbx kby kbz kcx kcy kcz rgb to yuv 099 3aa 100 12d 356 32a 03a 100 3d6 rgb to yc b c r 083 3b4 0e1 102 36b 344 032 0e1 3db yuv to rgb 100 100 100 000 3a8 1c6 167 349 000 yc b c r to rgb 149 149 149 000 3ce 102 0cc 398 000 port ain bin cin xout yout zout rgb to yuv r 7-0 g 7-0 b 7-0 y 7-0 u 7-0 (e) v 7-0 (e) rgb to yc b c r r 7-0 g 7-0 b 7-0 y 9-0 u 9-0 (e) v 9-0 (e) yuv to rgb y 8-1 (e) u 8-1 (e) v 8-1 (e) r 7-0 g 7-0 b 7-0 yc b c r to rgb y 9-0 c b9-0 (e) c r9-0 (e) r 7-0 g 7-0 b 7-0 hsv (hsi) format conversions hsv (or hsi) refers to hue (color), saturation (vividness), and value (intensity or brightness), quantities which are directly related to the human perception of light and color. the v (or i) levels are simply the y (or luminance) levels. hue and saturation are derived from the r-y and b-y color difference values of a signal. hsv calculations: value (v) = intensity (i) = y hue (h) = arctan (b-y/r-y) saturation (s) = r-y = s*cos(h) b-y = s*sin(h) one may use two 64kx8 rom look-up-tables to calculate hue and saturation from r-y and b-y in an 8-bit system. however, the ?ite size of this lut may limit performance, especially if the TMC2272A |